//
//  YZMediaManager.h
//  CocoaAsyncSocketClient
//
//  Created by lixiaoyi on 2018/6/26.
//  Copyright © 2018年 lixiaoyi. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YZMessageModel.h"
#import "YZMessageFrame.h"

#define kArrowMe @"Chat/ArrowMe"
#define kMyPic @"Chat/MyPic"
#define kVideoPic @"Chat/VideoPic"
#define kVideoImageType @"png"
#define kDeliver @"Deliver"

@interface YZMediaManager : NSObject

+ (instancetype)shareManager;

- (UIImage *)imageWithLocalPath:(NSString *)localPath;

- (void)clearReuseImageMessage:(YZMessageModel *)message;

// me to you
- (UIImage *)arrowMeImage:(UIImage *)image
                     size:(CGSize)imageSize
                mediaPath:(NSString *)mediaPath
                 isSender:(BOOL)isSender;

- (void)saveArrowMeImage:(UIImage *)image
           withMediaPath:(NSString *)mediPath;


/**
 创建图片保存地址

 @param mainFolder 主地址
 @param childFolder 子地址
 @return 图片地址
 */
- (NSString *)createFolderPathWithMainFolder:(NSString *)mainFolder
                                 childFolder:(NSString *)childFolder;


/**
 保存图片到沙盒

 @param image 图片
 @return 图片路径
 */
- (NSString *)saveImage:(UIImage *)image;

/**
 保存视频图片到沙盒

 @param image 视频图片
 @param fileName 文件名
 */
- (NSString *)saveVideoImage:(UIImage *)image
              fileName:(NSString *)fileName;

- (void)clearCaches;

/// video first cover image
- (UIImage *)videoConverPhotoWithVideoPath:(NSString *)videoPath
                                      size:(CGSize)imageSize
                                  isSender:(BOOL)isSender;


// 保存接收到图片 small-fileKey.png
- (NSString *)receiveImagePathWithFileKey:(NSString *)fileKey
                                     type:(NSString *)type;

// 小图路径
- (NSString *)smallImgPath:(NSString *)fileKey;



// 原图路径1
- (NSString *)originImgPath1:(YZMessageFrame *)messageF;


// get image with imgName
- (NSString *)imagePathWithName:(NSString *)imageName;


// get videoImage from sandbox
- (UIImage *)videoImageWithFileName:(NSString *)fileName;




@end
